<template>
	<view>
		<view class="head">
			<view class="head_left" @tap="back()">
				<image src="../../../static/wode/return.png" mode=""></image>
				<text>返回</text>
			</view>
			<view class="head_mid">
				{{title}}
			</view>
			<image v-if="type=='dongtai'" class="head_right" src="../../../static/wode/cream.png" mode="" @tap="toDongTai"></image>
			<image v-else class="head_right"  mode="" ></image>
		</view>
		<view class="marginTop">
			<!-- <moreCurious :isdongtai='isdongtai' :item="item" :isdel='isdel' ></moreCurious> -->
			<earth @showComment="showComment" @huifuComment="huifuComment" v-for="(item,index) in youquanList"
			 :key="index" :index="index" :item="item" :isMe="true" :isshoucang="true"></earth>
		</view>
	</view>
</template>
<script>
	// import moreCurious from '../../../components/moreCurious.vue'
	import earth from '../../../components/earth.vue'
	export default {
		components: {
			earth
		},
		data() {
			return {
				isImage: true,
				isVideo: true,
				youquanList:[],
				type:'',
				title:'',
				// isdongtai:true,
				// isdel:true,
			}
		},
		onLoad(option) {
			if(option.type=='dongtai'){
				this.type=option.type
				this.title='我的动态'
				this.getdata()
			}else if(option.type=='shoucang'){
				this.title='我的收藏'
				this.getshoucangdata()
			}
		},
		onShow() {
			
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},

			getdata() {
				var me = this;
				var data = {
					user_id: uni.getStorageSync('user_id'),
				}
				this.myAjaxNew({
					model: 'message',
					controllerName: "noteUser",
					actionName: 'queryListPage',
					data: data,
					successBack: function(res) {
						console.log(res)
						me.youquanList=res.data.data
						for(var i=0;i<me.youquanList.length;i++){
							me.youquanList[i].picts=me.youquanList[i].picts.split(',')
							// me.youquanList[i].cover=me.youquanList[i].cover.split(',')
						}
						console.log(me.youquanList)
					},
				})
			},
			getshoucangdata(){
				var me=this;
				var data={
					user_id:uni.getStorageSync('user_id'),
					status:1
				}
				this.myAjaxNew({
					model: 'message',
					controllerName: "noteUser",
					actionName: 'queryCollectListPage',
					data: data,
					successBack: function(res) {
						console.log(res,'收藏列表')
						if(res.data.data.length==0){
							uni.showToast({
								title:'暂无收藏',
								icon:'none'
							})
						}else{
							me.youquanList=res.data.data
							for(var i=0;i<me.youquanList.length;i++){
								me.youquanList[i].picts=me.youquanList[i].picts.split(',')
							}
						}
					}
				})
			},

			toDongTai() { //发布动态
				uni.navigateTo({
					url: "/pages/Friend/dongTai/dongTai"
				})
			},
		}
	}
</script>
<style scoped>
	.head {
		width: 100%;
		position: fixed;
		height: 162upx;
		display: flex;
		justify-content: space-between;
		font-size: 32upx;
		padding: 0 24upx;
		box-sizing: border-box;
		top: 0;
		z-index: 9999;
		background: #ffffff;
		box-sizing: border-box;
	}

	.head_left image {
		height: 36upx;
		width: 20upx;
		margin-right: 9upx;
	}

	.head_left {
		display: flex;
		align-items: center;
		color: #666666;
		padding-top: 70upx;
	}

	.head_mid {
		font-size: 36upx;
		color: #333333;
		padding-top: 90upx;
	}

	.head_right {
		width: 49upx;
		height: 40upx;
		padding-left: 40upx;
	}

	.marginTop {
		padding-top: 182upx;
	}
	
</style>
